home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
c
/
bk1.mac
< prev
next >
Wrap
Text File
|
1992-09-06
|
4KB
|
180 lines
/* BK1.MAC - Macros for the editor in the IDE of Borland's */
/* Turbo C++. Version 1.0 August 1992 */
/* Written by Bill Kline 71270,3464 */
/* */
/* DOS command to incorporate these macros in the Turbo C++ config file: */
/* cd \tc\bin <- Where tcconfig.tc and temc are. */
/* copy tcconfig.tc tcconfig.tco <- Save a copy of tcconfig. */
/* temc bkmacros.mac tcconfig.tc <- To add macros to config file. */
Script BK1EditMacros;
/* BKCOPYBLOCK: Copy block then hide block. */
Macro BKCopyBlock
CopyBlock;
ToggleHideBlock;
End;
/* BKMOVEBLOCK: Move block then hide block. */
Macro BKMoveBlock
MoveBlock;
ToggleHideBlock;
End;
/* COPYLINE: Copy the line the cursor is on. */
Macro CopyLine
LeftOfLine; /* Move cursor to Home. */
SetBlockBeg; /* ^K B. */
CursorDown;
SetBlockEnd; /* ^K K, line is selected. */
CopyBlock; /* Copy Line. */
ToggleHideBlock; /* Hide Block. */
End;
/* FUNCTIONSTUB: Use to make a function stub at the end of the file. */
/* To use, put cursor on 1st letter of function name. */
/* NOTE: May have to clean up stub created by this macro */
/* when used on a function having no arguments. */
Macro FunctionStub
SetMark (0);
SetBlockBeg;
WordRight;
CursorLeft;
CursorLeft;
SetBlockEnd;
EndCursor;
InsertText ("\n\n\n");
LeftOfLine;
InsertText ("void x");
RightOfLine;
BackspaceDelete;
CopyBlock;
RightOfLine;
InsertText (" ()\n{\n\n\n} /* END OF ");
CopyBlock;
ToggleHideBlock;
MoveToBlockEnd;
InsertText (" */\n\n");
MoveToMark (0);
End;
/* COMMENTINLINE: Uncomments a line of text. Move cursor to left of */
/* next line. */
Macro CommentInLine
LeftOfLine;
DeleteChar;
DeleteChar;
RightOfLine;
BackspaceDelete;
BackspaceDelete;
BackspaceDelete;
LeftOfLine;
CursorDown;
End;
/* COMMENTOUTLINE: Comments out a line of text. Move cursor to left of */
/* next line. */
Macro CommentOutLine
LeftOfLine;
InsertText ("/*");
RightOfLine;
InsertText (" */");
LeftOfLine;
CursorDown;
End;
/* MAKECOMMENT: Puts a blank commented out area at cursor. */
Macro MakeComment
LeftOfLine;
InsertText ("\n");
LeftOfLine;
InsertText ("/****************************************************************************");
InsertText ("\n\n\n\n");
LeftOfLine;
InsertText ("****************************************************************************/");
InsertText ("\n\n");
CursorUp;
CursorUp;
CursorUp;
CursorUp;
End;
/* COMMENTOUTBLOCK: Comments out a highlighted block of text. */
Macro CommentOutBlock
MoveToBlockBeg;
InsertText ("\n\n\n\n\n");
LeftOfLine;
CursorUp;
CursorUp;
CursorUp;
InsertText ("/****************************************************************************");
MoveToBlockEnd;
InsertText ("\n\n\n\n\n");
LeftOfLine;
CursorUp;
CursorUp;
CursorUp;
InsertText ("****************************************************************************/");
ToggleHideBlock;
LeftOfLine;
CursorDown;
End;
/* PARENSCURLYS: Put () {\n} at the cursor, move cursor to after (. */
Macro ParensCurlys
InsertText ("(");
SetMark (0);
InsertText (") {\n");
InsertText ("}");
MoveToMark (0);
End;
/* DELETE5LINES: Deletes 5 lines of text. Use to remove asterisk comment */
/* lines put in a file by COMMENTOUTBLOCK to uncomment block. */
Macro Delete5Lines
LeftOfLine;
DeleteLine;
DeleteLine;
DeleteLine;
DeleteLine;
DeleteLine;
LeftOfLine;
End;
/***** KEY BINDINGS: *****/
Alt-C: BKCopyBlock; /* I conflict, change my key if you want! */
Alt-V: BKMoveBlock;
Alt-L: CopyLine;
Alt-U: FunctionStub;
Alt-I: CommentInLine;
Alt-O: CommentOutLine; /* I conflict, change my key if you want! */
Alt-M: MakeComment;
Alt-B: CommentOutBlock;
Alt-A: ParensCurlys;
Alt-Y: Delete5Lines;